package testes;


import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import excessoes.ArrayIncompativel;

import rodadas.Tentativa;

public class TentativaTestValorLimite {
	private Tentativa tentativa;

	@Before
	public void setUp() throws Exception {
		tentativa = new Tentativa();
	}

	@After
	public void tearDown() throws Exception {
		tentativa = null;
	}

	@Test(expected=ArrayIncompativel.class)
	public void testTamanhoDoArrayVazio() throws Exception{
		int[] aux = {};
		tentativa.setTentativa(aux);
	}
	
	@Test(expected=ArrayIncompativel.class)
	public void testTamanhoDoArrayMenor() throws Exception{
		int[] aux = {1,2};
		tentativa.setTentativa(aux);
	}
	
	@Test(expected=ArrayIncompativel.class)
	public void testTamanhoDoArrayMaior() throws Exception{
		int[] aux = {1,2,3,4,5,6,7};
		tentativa.setTentativa(aux);
	}
	
	public void testTamanhoDoArray() throws Exception{
		int[] aux = {1,2,3,4};
		tentativa.setTentativa(aux);
		assertEquals(aux, tentativa.getTentativa());
	}
}
